﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>UrlGet: UrlGet.fsmcpp Source File</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                Examples using state machines generated by StateBuilderCpp
            </h1>
            <h3>
                UrlGet: UrlGet.fsmcpp Source File
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">UrlGet.fsmcpp</div>  </div>
</div>
<div class="contents">
<a href="_url_get_8fsmcpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;UTF-8&quot;</span>?&gt;
<a name="l00002"></a>00002 &lt;sm:StateMachine xmlns:sm=<span class="stringliteral">&quot;http://www.stateforge.com/StateMachineCpp-v1&quot;</span>
<a name="l00003"></a>00003                  xmlns:xsi=<span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span>
<a name="l00004"></a>00004                  xsi:schemaLocation=<span class="stringliteral">&quot;http://www.stateforge.com/StateMachineCpp-v1</span>
<a name="l00005"></a>00005 <span class="stringliteral">                                     http://www.stateforge.com/xsd/StateMachineCpp-v1.xsd&quot;</span> &gt;
<a name="l00006"></a>00006     &lt;!-- General settings --&gt;
<a name="l00007"></a>00007     &lt;settings asynchronous=<span class="stringliteral">&quot;true&quot;</span> library=<span class="stringliteral">&quot;qt&quot;</span>&gt;
<a name="l00008"></a>00008         &lt;description&gt;<span class="keyword">get</span> a web page from http and a file from ftp by <span class="keyword">using</span> the parallel feature&lt;/description&gt;
<a name="l00009"></a>00009         &lt;<span class="keywordtype">object</span> instance=<span class="stringliteral">&quot;urlGet&quot;</span> <span class="keyword">class</span>=<span class="stringliteral">&quot;UrlGet&quot;</span> include=<span class="stringliteral">&quot;UrlGet.h&quot;</span>/&gt;
<a name="l00010"></a>00010     &lt;/settings&gt;
<a name="l00011"></a>00011 
<a name="l00012"></a>00012     &lt;!-- Events --&gt;
<a name="l00013"></a>00013     &lt;events&gt;
<a name="l00014"></a>00014         &lt;eventSource name=<span class="stringliteral">&quot;ManagementEvent&quot;</span>&gt;
<a name="l00015"></a>00015             &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evStart&quot;</span>/&gt;
<a name="l00016"></a>00016             &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evStop&quot;</span>/&gt;
<a name="l00017"></a>00017         &lt;/eventSource&gt;
<a name="l00018"></a>00018         &lt;eventSource name=<span class="stringliteral">&quot;HttpEvent&quot;</span>&gt;
<a name="l00019"></a>00019             &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evHttpDone&quot;</span>/&gt;
<a name="l00020"></a>00020             &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evHttpDoneError&quot;</span>/&gt;
<a name="l00021"></a>00021         &lt;/eventSource&gt;
<a name="l00022"></a>00022         &lt;eventSource name=<span class="stringliteral">&quot;FtpEvent&quot;</span>&gt;
<a name="l00023"></a>00023             &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evFtpDone&quot;</span>/&gt;
<a name="l00024"></a>00024             &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evFtpDoneError&quot;</span>/&gt;
<a name="l00025"></a>00025         &lt;/eventSource&gt;
<a name="l00026"></a>00026         &lt;eventSource name=<span class="stringliteral">&quot;Timers&quot;</span>&gt;
<a name="l00027"></a>00027             &lt;timer <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evTimerMaxDuration&quot;</span> name=<span class="stringliteral">&quot;TimerMaxDuration&quot;</span>/&gt;
<a name="l00028"></a>00028         &lt;/eventSource&gt;
<a name="l00029"></a>00029     &lt;/events&gt;
<a name="l00030"></a>00030 
<a name="l00031"></a>00031     &lt;!-- States --&gt;
<a name="l00032"></a>00032     &lt;state name=<span class="stringliteral">&quot;Top&quot;</span>&gt;
<a name="l00033"></a>00033         &lt;!-- <span class="keywordflow">default</span> transitions --&gt;
<a name="l00034"></a>00034         &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evTimerMaxDuration&quot;</span> nextState=<span class="stringliteral">&quot;End&quot;</span> description=<span class="stringliteral">&quot;time out error&quot;</span>&gt;
<a name="l00035"></a>00035             &lt;action&gt;<span class="comment">//TODO&lt;/action&gt;</span>
<a name="l00036"></a>00036         &lt;/transition&gt;
<a name="l00037"></a>00037         &lt;!-- Idle state --&gt;
<a name="l00038"></a>00038         &lt;state name=<span class="stringliteral">&quot;Idle&quot;</span>&gt;
<a name="l00039"></a>00039             &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evStart&quot;</span> nextState=<span class="stringliteral">&quot;Running&quot;</span>&gt;
<a name="l00040"></a>00040                 &lt;timerStart timer=<span class="stringliteral">&quot;TimerMaxDuration&quot;</span> duration=<span class="stringliteral">&quot;30000&quot;</span>/&gt;
<a name="l00041"></a>00041             &lt;/transition&gt;
<a name="l00042"></a>00042         &lt;/state&gt;
<a name="l00043"></a>00043         &lt;state name=<span class="stringliteral">&quot;Running&quot;</span>&gt;
<a name="l00044"></a>00044             &lt;parallel nextState=<span class="stringliteral">&quot;End&quot;</span>&gt;
<a name="l00045"></a>00045                 &lt;!-- State Http --&gt;
<a name="l00046"></a>00046                 &lt;state name=<span class="stringliteral">&quot;Http&quot;</span>&gt;
<a name="l00047"></a>00047                     &lt;!-- State HttpGet --&gt;
<a name="l00048"></a>00048                     &lt;state name=<span class="stringliteral">&quot;HttpGet&quot;</span> description=<span class="stringliteral">&quot;fetch a web page&quot;</span>&gt;
<a name="l00049"></a>00049                         &lt;onEntry action=<span class="stringliteral">&quot;urlGet.httpStart()&quot;</span>/&gt;
<a name="l00050"></a>00050                         &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evHttpDone&quot;</span> nextState=<span class="stringliteral">&quot;HttpEnd&quot;</span> description=<span class="stringliteral">&quot;http done&quot;</span>/&gt;
<a name="l00051"></a>00051                         &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evHttpDoneError&quot;</span> nextState=<span class="stringliteral">&quot;End&quot;</span> description=<span class="stringliteral">&quot;http error&quot;</span>/&gt;
<a name="l00052"></a>00052                     &lt;/state&gt;
<a name="l00053"></a>00053                     &lt;!-- State HttpEnd --&gt;
<a name="l00054"></a>00054                     &lt;state name=<span class="stringliteral">&quot;HttpEnd&quot;</span> kind=<span class="stringliteral">&quot;final&quot;</span>/&gt;
<a name="l00055"></a>00055                 &lt;/state&gt;
<a name="l00056"></a>00056                 &lt;!-- State Http --&gt;
<a name="l00057"></a>00057 
<a name="l00058"></a>00058                 &lt;!-- State Ftp --&gt;
<a name="l00059"></a>00059                 &lt;state name=<span class="stringliteral">&quot;Ftp&quot;</span>&gt;
<a name="l00060"></a>00060                     &lt;!-- State FtpGet --&gt;
<a name="l00061"></a>00061                     &lt;state name=<span class="stringliteral">&quot;FtpGet&quot;</span> description=<span class="stringliteral">&quot;get a file from Ftp&quot;</span>&gt;
<a name="l00062"></a>00062                         &lt;onEntry action=<span class="stringliteral">&quot;urlGet.ftpStart()&quot;</span>/&gt;
<a name="l00063"></a>00063                         &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evFtpDone&quot;</span> nextState=<span class="stringliteral">&quot;FtpEnd&quot;</span> description=<span class="stringliteral">&quot;ftp done&quot;</span>/&gt;
<a name="l00064"></a>00064                         &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evFtpDoneError&quot;</span> nextState=<span class="stringliteral">&quot;End&quot;</span> description=<span class="stringliteral">&quot;ftp error&quot;</span>/&gt;
<a name="l00065"></a>00065                     &lt;/state&gt;
<a name="l00066"></a>00066                     &lt;!-- State FtpEnd --&gt;
<a name="l00067"></a>00067                     &lt;state name=<span class="stringliteral">&quot;FtpEnd&quot;</span> kind=<span class="stringliteral">&quot;final&quot;</span>/&gt;
<a name="l00068"></a>00068                 &lt;/state&gt;
<a name="l00069"></a>00069                 &lt;!-- State Ftp --&gt;
<a name="l00070"></a>00070             &lt;/parallel&gt;
<a name="l00071"></a>00071         &lt;/state&gt;
<a name="l00072"></a>00072         &lt;state name=<span class="stringliteral">&quot;End&quot;</span> kind=<span class="stringliteral">&quot;final&quot;</span>/&gt;
<a name="l00073"></a>00073     &lt;/state&gt;
<a name="l00074"></a>00074 &lt;/sm:StateMachine&gt;
<a name="l00075"></a>00075 
</pre></div></div>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
